package com.hinner.configuration;

import com.hinner.utils.QRCodeUtil;
import net.sourceforge.tess4j.Tesseract;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: PengFei.He
 * @Date: 2024/11/21 07:17
 * @Function:
 */
@Configuration
public class TesseractConfiguration {

    @Value("${tess4j.datapath}")
    private String dataPath;

    @Bean
    public Tesseract tesseract(){
        Tesseract tesseract = new Tesseract();
        tesseract.setDatapath(dataPath);
        tesseract.setDatapath("chi_sim");
        return tesseract;
    }

    @Bean
    public QRCodeUtil qrCodeUtil(){
        return new QRCodeUtil();
    }
}
